package com.punch.user.mapper;


import com.punch.common.model.SysMenu;
import com.punch.db.mapper.SuperMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 菜单
 *
 * @author zlt
 */
@Mapper
public interface SysMenuMapper extends SuperMapper<SysMenu> {

    /**
     * 根据父id查找所有子id
     *
     * @param parentId 父id
     * @return List<Integer>
     * @author wujj
     * @since 2020/6/11 18:22
     */
    List<Long> selectAllChildIdByPid(@Param("parentId") Long parentId);

    /**
     * 批量隐藏子菜单
     *
     * @param childIdList 子菜单列表
     * @param hiddenFlag  状态
     * @author wujj
     * @since 2020/6/16 9:57
     */
    void updateMenuStatusByList(@Param("childIdList") List<Long> childIdList, @Param("hiddenFlag") Integer hiddenFlag);


    /**
     * 节点子级个数 +1
     *
     * @param menuId id
     * @author wujj
     * @since 2020/6/11 18:43
     */
    void addChildNum(@Param("menuId") Long menuId);

    /**
     * 节点子级个数 -1
     *
     * @param menuId id
     * @author wujj
     * @since 2020/6/11 18:43
     */
    void subChildNum(@Param("menuId") Long menuId);
}
